<style>
    .generator-code-brower {
        height: calc(100% - 52px);
    }
</style>
<div id="generator-code-brower" class="generator-code-brower"></div>
<div class="detail_form_footer">
    <a class="layui-btn btn-preview-download">下载</a>
    <a class="layui-btn layui-btn-primary btn-preview-cancle">关闭</a>
</div>
<!-- @formatter:off -->
<script>
    layui.use(["xce"],function(){
        let $ = layui.$;
        let xce = layui.xce;
        let thisIndex = layer.index;
        xce.render({
            elem: "#generator-code-brower",
            api: "/generator/code/xceApi?generator_id=#(generatorModel.generator_id)", // xce对应后台接口
            readOnly: true,
        })
        $('.btn-preview-download').click(function(){
            window.open('/generator/code/download?generator_id=#(generatorModel.generator_id)');
        });
        $('.btn-preview-cancle').click(function(){
            layer.close(thisIndex);
        });
    });
</script>
<!-- @formatter:on -->